#!/usr/bin/perl
#connectnv.cgi	Conn/Disconn a net volume1

require './folderman-lib.pl';
&ReadParse();
#&header("abc");
error_setup("error");
@abc = get_netvol_info($in{'volname'});

@dd=vol_mount_status($abc[1]);
my $volname = $abc[0];
my $path = "/netvol/".$volname;
my $src = $abc[1];
if($dd[0]){

	`umount $path 2>/dev/null`;
	$rc = $?>>8;
	if($rc){
		$err_msg = $text{'err_umnt_busy'};
		&error($err_msg);
	}
}
else{
	`mount $src $path 2>/dev/null`;
	$rc = $?>>8;
	$err_msg=$rc;
	if($rc){
		$err_msg = $text{'err_mount'};
		&error($err_msg);
	}
}
#&footer("abc");
&redirect("index.cgi");
